Cancelled
Push — release/2.1.0 ( 9888ea )
by Kevin Van
09:55 queued 09:52
created

Card   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1
1
import React, { FunctionComponent } from "react"
2
import classNames from "classnames"
3
4
import Icon from "./Icon"
5
6
import "./Card.scss"
7
8
const Card: FunctionComponent<CardProps> = ({ className, hasTable, title, titleIcon, children }) => (
9
  <article
10
    className={classNames(`card`, className, {
11
      "card--has-table": hasTable,
12
    })}
13
  >
14
    <header className={`card__header`}>
15
      <h4>
16
        {titleIcon !== `` && <Icon icon={titleIcon} />} {title}
17
      </h4>
18
    </header>
19
    <div className={`card__content`}>{children}</div>
20
  </article>
21
)
22
23
Card.defaultProps = {
24
  className: ``,
25
  hasTable: false,
26
  titleIcon: ``,
27
}
28
29
export default Card
30